﻿using System;
using System.Collections.Generic;
using System.Text;
using VIA.Foundation;

namespace VIA.Integration.LeadShine.Presentation
{
    public class VelocityCurveModel : Model
    {
        private double? _maxvel = 1;
        double _strvel;
        double _tacc = 0.1;
        double _tdec = 0.1;
        /// <summary>
        ///  开始速度pps
        ///  Starting velocity (mm/s)
        /// </summary>
        public double Strvel
        {
            get => _strvel;
            set => SetProperty(ref _strvel, value);
        }

        /// <summary>
        ///  最大速度pps（即稳定运行的速度）
        ///  max velocity (mm/s)
        /// </summary>
        public double? Maxvel
        {
            get => _maxvel;
            set => SetProperty(ref _maxvel, value);
        }

        /// <summary>
        /// 结束速度pps（结束时运行的速度）
        ///  max velocity (mm/s)
        /// </summary>
        public double Endvel { get; set; }

        /// <summary>
        /// 加速时间s 
        /// acceleration time (m/s2)
        /// </summary>
        public double Tacc
        {
            get => _tacc;
            set => SetProperty(ref _tacc, value);
        }

        /// <summary>
        ///  减速时间s
        ///  deceleration time (m/s2)
        /// </summary>
        public double Tdec
        {
            get => _tdec;
            set => SetProperty(ref _tdec, value);
        }
    }
    /// <summary>
    ///     运动点位
    /// </summary>
    public class MotionPathModel : Model
    {
        private string _id;
        private string _name;
        private double _target;
        VelocityCurveModel _velocityCurve = new VelocityCurveModel();

        /// <summary>
        ///     标识
        /// </summary>
        public string Id
        {
            get => _id;
            set => SetProperty(ref _id, value);
        }

        /// <summary>
        ///     名称
        /// </summary>
        //[Required, StringLength(6), DisplayName(@"名称")]
        public string Name
        {
            get => _name;
            set => SetProperty(ref _name, value);
        }

        /// <summary>
        ///     点位值
        /// </summary>
        public double Target
        {
            get => _target;
            set => SetProperty(ref _target, value);
        }
        public VelocityCurveModel VelocityCurve
        {
            get => _velocityCurve;
            set => SetProperty(ref _velocityCurve, value);
        }

    }
}
